

#ifndef UC_GEELL3D_H
#define UC_GEELL3D_H

#include "zgecurv3d.h"
#include "zgevec3d.h"
#include "zgepnt3d.h"
#include "zgeintrvl.h"
#include "zgeponc3d.h"
#include "zgeplane.h"
#pragma pack (push, 8)

class UcGeEllipArc2d;
class UcGeCircArc3d;
class UcGeLineEnt3d;
class UcGePlanarEnt;

class
GE_DLLEXPIMPORT
UcGeEllipArc3d : public UcGeCurve3d
{
public:

    UcGeEllipArc3d();
    UcGeEllipArc3d(const UcGeEllipArc3d& ell);
    UcGeEllipArc3d(const UcGeCircArc3d& arc);
    UcGeEllipArc3d(const UcGePoint3d& cent, const UcGeVector3d& majorAxis,
                   const UcGeVector3d& minorAxis, double majorRadius,
                   double minorRadius);
    UcGeEllipArc3d(const UcGePoint3d& cent, const UcGeVector3d& majorAxis,
                   const UcGeVector3d& minorAxis, double majorRadius,
                   double minorRadius, double ang1, double ang2);

    UcGePoint3d    closestPointToPlane(const UcGePlanarEnt& plane,
                                  UcGePoint3d& pointOnPlane,
                                  const UcGeTol& = UcGeContext::gTol) const;

    ZSoft::Boolean intersectWith (const UcGeLinearEnt3d& line, int& intn,
                                  UcGePoint3d& p1, UcGePoint3d& p2,
                                  const UcGeTol& tol = UcGeContext::gTol) const;  
    ZSoft::Boolean intersectWith (const UcGePlanarEnt& plane, int& numOfIntersect,
                                  UcGePoint3d& p1, UcGePoint3d& p2,
                                  const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean projIntersectWith(const UcGeLinearEnt3d& line,
                                  const UcGeVector3d& projDir, int &numInt,
                                  UcGePoint3d& pntOnEllipse1,
                                  UcGePoint3d& pntOnEllipse2,
                                  UcGePoint3d& pntOnLine1,
                                  UcGePoint3d& pntOnLine2,
                                  const UcGeTol& tol = UcGeContext::gTol) const;

    void           getPlane      (UcGePlane& plane) const;

    ZSoft::Boolean isCircular    (const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean isInside      (const UcGePoint3d& pnt,
                                  const UcGeTol& tol = UcGeContext::gTol) const;

    UcGePoint3d    center        () const;
    double         minorRadius   () const;
    double         majorRadius   () const;
    UcGeVector3d   minorAxis     () const;
    UcGeVector3d   majorAxis     () const;
    UcGeVector3d   normal        () const; 
    double         startAng      () const;
    double         endAng        () const;
    UcGePoint3d    startPoint    () const;
    UcGePoint3d    endPoint      () const;

    UcGeEllipArc3d& setCenter     (const UcGePoint3d& cent);
    UcGeEllipArc3d& setMinorRadius(double rad);
    UcGeEllipArc3d& setMajorRadius(double rad);
    UcGeEllipArc3d& setAxes       (const UcGeVector3d& majorAxis, const UcGeVector3d& minorAxis);
    UcGeEllipArc3d& setAngles     (double startAngle, double endAngle);
    UcGeEllipArc3d& set           (const UcGePoint3d& cent,
                                   const UcGeVector3d& majorAxis,
                                   const UcGeVector3d& minorAxis,
                                   double majorRadius, double minorRadius);
    UcGeEllipArc3d& set           (const UcGePoint3d& cent,
                                   const UcGeVector3d& majorAxis,
                                   const UcGeVector3d& minorAxis,
                                   double majorRadius, double minorRadius,
                                   double startAngle, double endAngle);
    UcGeEllipArc3d& set           (const UcGeCircArc3d&);

    UcGeEllipArc3d& operator =    (const UcGeEllipArc3d& ell);
};

#pragma pack (pop)
#endif
